package com.tedu.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.tedu.dao.IOrderDao;
import com.tedu.model.Order;
@Repository
public class OrderDao extends BaseDao<Order> implements IOrderDao {
	/**
	 * ��ȡ��¼�û����ж���
	 */
	public List<Order> list(int uid) {
		List<Order> orders = openSession().selectList(Order.class.getName() + ".list", uid);
		return orders;
	}
	/**
	 * ��ȡ��¼�û���ͬ״̬����
	 */
	public List<Order> listByStatus(Map<String, Object> args) {
		List<Order> orders = openSession().selectList(Order.class.getName() + ".listByStatus", args);
		return orders;
	}
	/**
	 * ��ȡ��¼�û���ͬ״̬��������
	 */
	public int countByStatus(Map<String, Object> args) {
		int count = openSession().selectOne(Order.class.getName() + ".countByStatus", args);
		return count;
	}

	@Override
	public void cancel(int orderid) {
		// TODO Auto-generated method stub
		openSession().selectOne(Order.class.getName() + ".cancel", orderid);
		
	}
	@Override
	public List<Order> listBySearch(Map<String, Object> args) {
		
		List<Order> orders = openSession().selectList(Order.class.getName() + ".listSearch", args);
		
		return orders;
	
	}







	/**
	 *后台显示
	 */
	@Override
	public List<Order> adminlist(int status) {
		// TODO Auto-generated method stub
		List<Order> orders = openSession().selectList(Order.class.getName() + ".adminlistByStatus", status);
		return orders;
	}
	/**
	 * 后台搜索
	 */
	@Override
	public List<Order> adminsearch(String str) {
		// TODO Auto-generated method stub
		List<Order> orders = openSession().selectList(Order.class.getName() + ".adminlistBystr", str);
		return orders;
	}
	/**
	 * 后台按月统计
	 */
	@Override
	public List<Order> adminmouthorder() {
		// TODO Auto-generated method stub
		List<Order> orders = openSession().selectList(Order.class.getName() + ".adminmouthorder");
		return orders;
	}
	
}
